package com.fqgj.xjd.user.client.enums;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: sm
 * Date: 2017/3/16
 * Time: 下午8:37
 */
public enum UserTypeEnum {
    ALL(0, "未知"),
    ADULT(1, "成人"),
    SUTDENT(2, "学生");

    private Integer type;

    private String desc;

    UserTypeEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public UserTypeEnum setType(Integer type) {
        this.type = type;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public UserTypeEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public static UserTypeEnum getEnumByType(Integer type) {
        UserTypeEnum userTagTypeEnum = null;
        for (UserTypeEnum u : UserTypeEnum.values()) {
            if (u.getType().equals(type)) {
                userTagTypeEnum = u;
            }
        }

        return userTagTypeEnum;
    }

    public static List<UserTypeEnum> getAuditEnums(){
        List<UserTypeEnum> userTagTypeEnumList = new ArrayList<>();
        for (UserTypeEnum userTagTypeEnum : UserTypeEnum.values()){
            userTagTypeEnumList.add(userTagTypeEnum);
        }
        return userTagTypeEnumList;
    }

}
